import {createRouter, createWebHistory, RouteRecordRaw, RouterOptions} from 'vue-router'

// 路由列表
const routes: RouteRecordRaw[] = [
    {
        path: '/', component: () => import('./../pages/FrontLayout.vue'), name: 'FrontLayout',
        children:[
            {path: '/', component: () => import('./../pages/Home.vue'), name: 'Home'},
            {path: '/search', component: () => import('./../pages/Home.vue'), name: 'Search'},
            {path: '/detail', component: () => import('./../pages/Detail.vue'), name: 'Detail'},

            {path: '/user/orders', component: () => import('./../pages/Home.vue'), name: 'Orders'}
        ]
    },
    {path: '/user/login', component: () => import('./../pages/user/Login.vue'), name: 'Login'},
    {path: '/user/carts', component: () => import('./../pages/Home.vue'), name: 'Carts'},
];

const router = createRouter({
    routes,
    history: createWebHistory()
})
// 到处路由对象
export default router